<meta charset='utf-8'>
<?php

class IndexController extends Controller{

    public function index(){
        $model = f::m('Index');
        $res   = $model->indexlist();
        $this->assign('res',$res);
        $this->display();
    }
    public function delete(){
        $model = f::m('Index');
        $id    = $_GET['id'];
        $res   = $model->deletelist($id);
        if($res){
            echo '<script>
                alert("删除成功！");window.location.href="index.php"</script>';
        }else{
            echo '<script>
                alert("删除失败！");window.location.href="index.php"</script>';
        }
    }
    public function update(){
        $model = f::m('Index');
        $id    = $_GET['id'];
        $res   = $model->getone($id);
    }

}

?>